package service

import (
	"github.com/e421083458/gorm"
	"github.com/gin-gonic/gin"
	"micro-server/public"
	"micro-server/vender/article/model"
)

// 用户 - 查询客服
func GetArticle(c *gin.Context, db *gorm.DB, limit int) (data []model.WkbArticle, err error) {
	// 查db
	err = db.SetCtx(public.GetGinTraceContext(c)).
		Model(&model.WkbArticle{}).
		Limit(limit).
		Order("id DESC").
		Scan(&data).Error
	if err != nil {
		return
	}
	return
}
